//
//  instroduce.m
//  EFExtend
//
//  Created by mac on 15/3/20.
//  Copyright (c) 2015年 Eric. All rights reserved.
//
/*
 在UIScrollView顺序排列一些view并自动计算contentSize
 UIScrollView *scrollView = [UIScrollView new];
 scrollView.backgroundColor = [UIColor whiteColor];
 [sv addSubview:scrollView];
 [scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
 make.edges.equalTo(sv).with.insets(UIEdgeInsetsMake(5,5,5,5));
 }];
 UIView *container = [UIView new];
 [scrollView addSubview:container];
 [container mas_makeConstraints:^(MASConstraintMaker *make) {
 make.edges.equalTo(scrollView);
 make.width.equalTo(scrollView);
 }];
 int count = 10;
 UIView *lastView = nil;
 for ( int i = 1 ; i <= count ; ++i )
 {
 UIView *subv = [UIView new];
 [container addSubview:subv];
 subv.backgroundColor = [UIColor colorWithHue:( arc4random() % 256 / 256.0 )
 saturation:( arc4random() % 128 / 256.0 ) + 0.5
 brightness:( arc4random() % 128 / 256.0 ) + 0.5
 alpha:1];
 
 [subv mas_makeConstraints:^(MASConstraintMaker *make) {
 make.left.and.right.equalTo(container);
 make.height.mas_equalTo(@(20*i));
 
 if ( lastView )
 {
 make.top.mas_equalTo(lastView.mas_bottom);
 }
 else
 {
 make.top.mas_equalTo(container.mas_top);
 }
 }];
 
 lastView = subv;
 }
 [container mas_makeConstraints:^(MASConstraintMaker *make) {
 make.bottom.equalTo(lastView.mas_bottom);
 }];
 */

/*
 @implementation UIView(Masonry_LJC)
 - (void) distributeSpacingHorizontallyWith:(NSArray*)views
 {
 NSMutableArray *spaces = [NSMutableArray arrayWithCapacity:views.count+1];
 
 for ( int i = 0 ; i < views.count+1 ; ++i )
 {
 UIView *v = [UIView new];
 [spaces addObject:v];
 [self addSubview:v];
 
 [v mas_makeConstraints:^(MASConstraintMaker *make) {
 make.width.equalTo(v.mas_height);
 }];
 }
 
 UIView *v0 = spaces[0];
 
 __weak __typeof(&*self)ws = self;
 
 [v0 mas_makeConstraints:^(MASConstraintMaker *make) {
 make.left.equalTo(ws.mas_left);
 make.centerY.equalTo(((UIView*)views[0]).mas_centerY);
 }];
 
 UIView *lastSpace = v0;
 for ( int i = 0 ; i < views.count; ++i )
 {
 UIView *obj = views[i];
 UIView *space = spaces[i+1];
 
 [obj mas_makeConstraints:^(MASConstraintMaker *make) {
 make.left.equalTo(lastSpace.mas_right);
 }];
 
 [space mas_makeConstraints:^(MASConstraintMaker *make) {
 make.left.equalTo(obj.mas_right);
 make.centerY.equalTo(obj.mas_centerY);
 make.width.equalTo(v0);
 }];
 
 lastSpace = space;
 }
 
 [lastSpace mas_makeConstraints:^(MASConstraintMaker *make) {
 make.right.equalTo(ws.mas_right);
 }];
 
 }
 - (void) distributeSpacingVerticallyWith:(NSArray*)views
 {
 NSMutableArray *spaces = [NSMutableArray arrayWithCapacity:views.count+1];
 
 for ( int i = 0 ; i < views.count+1 ; ++i )
 {
 UIView *v = [UIView new];
 [spaces addObject:v];
 [self addSubview:v];
 
 [v mas_makeConstraints:^(MASConstraintMaker *make) {
 make.width.equalTo(v.mas_height);
 }];
 }
 
 
 UIView *v0 = spaces[0];
 
 __weak __typeof(&*self)ws = self;
 
 [v0 mas_makeConstraints:^(MASConstraintMaker *make) {
 make.top.equalTo(ws.mas_top);
 make.centerX.equalTo(((UIView*)views[0]).mas_centerX);
 }];
 
 UIView *lastSpace = v0;
 for ( int i = 0 ; i < views.count; ++i )
 {
 UIView *obj = views[i];
 UIView *space = spaces[i+1];
 
 [obj mas_makeConstraints:^(MASConstraintMaker *make) {
 make.top.equalTo(lastSpace.mas_bottom);
 }];
 
 [space mas_makeConstraints:^(MASConstraintMaker *make) {
 make.top.equalTo(obj.mas_bottom);
 make.centerX.equalTo(obj.mas_centerX);
 make.height.equalTo(v0);
 }];
 
 lastSpace = space;
 }
 
 [lastSpace mas_makeConstraints:^(MASConstraintMaker *make) {
 make.bottom.equalTo(ws.mas_bottom);
 }];
 }
 @end
 */
#import "instroduce.h"


@interface instroduce ()

@end

@implementation instroduce

#pragma mark - life cycle

- (void)dealloc
{
   
    HM_SUPER_DEALLOC();
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
    
    [self.customNavLeftBtn setImage:[UIImage imageNamed:@"back.png"] forState:UIControlStateNormal];
    [self.customNavLeftBtn setFrame:CGRectMakeBound(32, 32)];
    
    NSString *introduce = @"该框架使用了Bee的核心，Three20的页面跳转方式，整合第三方常用库，个人整理了以上对原生开发的支持，开发协同中建立“约定”比“规定”要合理。在框架的使用上有几个注意点：\n1.UIViewController的使用请直接继承HMUIBoard；\n2.UINavigatonController的使用请直接继承HMUIStack；\n3.UITabBarViewcontroller请使用了HMUITapBarView做切换控制，支持更多的tab样式；\n4.按钮的使用上请使用UIButten，一键支持事件监听，提供block和方法回调ON_BUTTON()的方式；\n5.自定义弹出框，请查看UI相关>弹出框;\n6.关于Autolayout的支持,我在写demo的时候已经尽量去使用\n目前包含的开源库如下:\npod 'AFNetworking', '~> 2.5.1'\n\
    pod 'MBProgressHUD', '~> 0.9.1'\n\
    pod 'OpenUDID', '~> 1.0.0'\n\
    pod 'FMDB', '~> 2.5'\n\
    pod 'ZXingObjC', '~> 3.0.4'\n\
    pod 'ZipArchive', '~> 1.3.0'\n\
    pod 'WebViewJavascriptBridge', '~> 4.1.4'\n\
    pod 'Masonry', '~> 0.6.1'#autolayout 工具库\n\
    pod 'Ono', '~> 1.2.0'#xml html解析库\n\
    pod 'pop', '~> 1.0.7'#facebook动画库\n\
    pod 'GPUImage', '~> 0.1.6'#图片滤镜、效果库\n\
    pod 'MJRefresh', '~> 1.4.3'#下拉刷新\n\
    pod 'RATreeView', '~> 1.0.1'#树状列表\n\
    pod 'CSStickyHeaderFlowLayout', '~> 0.2.5'#collection header\n\
    pod 'UITableView+FDTemplateLayoutCell'";
    
    UITextView *label = [UITextView spawn];
    label.text = introduce;
    label.tag = 2;
    label.font = [UIFont systemFontOfSize:18];
    [self.view addSubview:label];
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.mas_equalTo(self.view.mas_top).offset(0);
//        make.left.mas_equalTo(self.view.mas_left).offset(0);
//        make.bottom.mas_equalTo(self.view.mas_bottom).offset(0);
//        make.right.mas_equalTo(self.view.mas_right).offset(0);
        make.edges.mas_equalTo(self.view);
    }];
    
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - view init

#pragma mark - delegate

#pragma mark - event response


ON_Button(signal){
    UIButten *btn = signal.source;
    if ([signal is:[UIButten TOUCH_UP_INSIDE]]) {
        if ([btn is:@"leftBtn"]) {//customNavLeftBtn
      
            [self backWithAnimate:YES];
        }else if ([btn is:@"rightBtn"]){//customNavRightBtn
            
        }
    }
}

#pragma mark - private methods getters setters
@end
